﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;

namespace LandPortMoblieWeb.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult OneRequest()
        {
            var nn = Request["name"];
            object cc=null;
            if (!string.IsNullOrEmpty(nn.ToString()))
            {
                cc = new { success = "whywhywhy" };
            }
            

          //var strjson="{'success':'whywhy'}";
           var json=JsonConvert.SerializeObject(cc);
           return Json(cc,JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public ActionResult PostRequst(string name,string vildata)
        {
            object cc = null;
            if (!string.IsNullOrEmpty(name))
            {
                cc = new { success = true, massage = "大唐" };
            }
            else
            {
                cc = new { success = false };
            }

            return Json(cc);

        }

    }
}
